<?php
/**
 *
 */
class home extends CI_Controller {

  public function __construct() {
    parent::__construct();
    $this->load->helper('url');
    $this->load->library('session');
    $this->load->model('M_updateUtil');
    if($this->session->userdata('username')==null){
      redirect('/login');
    }
  }
  public function index(){
    $this->load->view('home');
  }
  public function updatepwd(){
    if(!empty($_POST['opwd']) || !empty($_POST['npwd'])){
      echo $this->M_updateUtil->updatepwd($this->session->userdata('username'),$_POST['opwd'],$_POST['npwd']);
    }else{
      echo 'false';
    }
  }
}
